<!doctype html>
<html lang="en-us">
<head>
  <meta charset="utf-8">
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>防御者放置：新起点 - Defender Idle</title>
  <style>
    * {
      margin: 0;
      padding: 0;
    }

    #gameContainer canvas {
      display:block;
    }

    div#webgl-content {
      position: absolute;
      top: 50%;
      left: 50%;
      -webkit-transform: translate(-50%, -50%);
      transform: translate(-50%, -50%);
    }

    div#loadingBox {
      width: 100%;
      height: 0px;
      position: absolute;
      top: 50%;
      margin-top: 137px;
      text-align: center;
    }

    div#icon {
      width: 300px;
      height: 310px;
      position: absolute;
      top: 50%;
      left: 50%;
      margin-top: -185px;
      margin-left: -150px;
      background-image: url("Template/anthill.png");
      background-repeat: no-repeat;
      box-shadow: 1px 1px 5px #141414;
    }

    div#box {
      width: 328px;
      height: 367px;
      position: absolute;
      top: 50%;
      left: 50%;
      margin-top: -199px;
      margin-left: -164px;
      background: #222;
      box-shadow: 1px 1px 5px #000;
    }

    div#bgBar {
      display: none;
      position: absolute;
      width: 300px;
      margin-left: -150px;
      left: 50%;
      height: 18px;
      background-color: #882121;
      box-shadow: 1px 1px 5px #111;
    }

    div#progressBar {
      display: none;
      left: 50%;
      position: absolute;
      margin-left: -150px;
      width: 0px;
      height: 18px;
      background-color: #dc4241;
    }

    p#loadingInfo {
      color: #fff;
      letter-spacing: 1px;
      position: absolute;
      width: 100%;
      font-family: sans-serif;
      text-align: center;
      top: 50%;
      font-size: 11px;
      font-weight: 500;
      margin-top: 140px;
      text-shadow: 0px 0px 5px #000;
    }

    div#spinner {
      position: absolute;
      height: 18px;
      left: 50%;
      margin-left: -150px;
      width: 300px;
      position: relative;
      overflow: hidden;
      background-color: #882121;
      box-shadow: 1px 1px 5px #111;
    }

    div#spinner:before {
      display: block;
      position: absolute;
      content: "";
      width: 150%;
      margin-left: -10px;
      height: 10px;
      background-color: #e85352;
      transform: rotate(-5deg);
      animation: loading 1s linear infinite;
    }

    @keyframes loading {
      from {
        top: -185%
      }
      to {
        top: 225%
      }
    }
  </style>

  <script src='kongregate_api.js'>
  </script>
  <script>
      (function (root, factory) {
    if (typeof define === 'function' && define.amd) {
      // AMD. Register as an anonymous module.
      define([], factory);
    } else if (typeof exports === 'object') {
      // Node. Does not work with strict CommonJS, but
      // only CommonJS-like environments that support module.exports,
      // like Node.
      module.exports = factory();
    } else {
      // Browser globals (root is window)
      root.download = factory();
    }
  }(this, function () {

    return function download(data, strFileName, strMimeType) {

      var self = window, // this script is only for browsers anyway...
        defaultMime = "application/octet-stream", // this default mime also triggers iframe downloads
        mimeType = strMimeType || defaultMime,
        payload = data,
        url = !strFileName && !strMimeType && payload,
        anchor = document.createElement("a"),
        toString = function(a){return String(a);},
        myBlob = (self.Blob || self.MozBlob || self.WebKitBlob || toString),
        fileName = strFileName || "download",
        blob,
        reader;
        myBlob= myBlob.call ? myBlob.bind(self) : Blob ;
      
      if(String(this)==="true"){ //reverse arguments, allowing download.bind(true, "text/xml", "export.xml") to act as a callback
        payload=[payload, mimeType];
        mimeType=payload[0];
        payload=payload[1];
      }


      if(url && url.length< 2048){ // if no filename and no mime, assume a url was passed as the only argument
        fileName = url.split("/").pop().split("?")[0];
        anchor.href = url; // assign href prop to temp anchor
          if(anchor.href.indexOf(url) !== -1){ // if the browser determines that it's a potentially valid url path:
              var ajax=new XMLHttpRequest();
              ajax.open( "GET", url, true);
              ajax.responseType = 'blob';
              ajax.onload= function(e){ 
            download(e.target.response, fileName, defaultMime);
          };
              setTimeout(function(){ ajax.send();}, 0); // allows setting custom ajax headers using the return:
            return ajax;
        } // end if valid url?
      } // end if url?


      //go ahead and download dataURLs right away
      if(/^data\:[\w+\-]+\/[\w+\-]+[,;]/.test(payload)){
      
        if(payload.length > (1024*1024*1.999) && myBlob !== toString ){
          payload=dataUrlToBlob(payload);
          mimeType=payload.type || defaultMime;
        }else{      
          return navigator.msSaveBlob ?  // IE10 can't do a[download], only Blobs:
            navigator.msSaveBlob(dataUrlToBlob(payload), fileName) :
            saver(payload) ; // everyone else can save dataURLs un-processed
        }
        
      }//end if dataURL passed?

      blob = payload instanceof myBlob ?
        payload :
        new myBlob([payload], {type: mimeType}) ;


      function dataUrlToBlob(strUrl) {
        var parts= strUrl.split(/[:;,]/),
        type= parts[1],
        decoder= parts[2] == "base64" ? atob : decodeURIComponent,
        binData= decoder( parts.pop() ),
        mx= binData.length,
        i= 0,
        uiArr= new Uint8Array(mx);

        for(i;i<mx;++i) uiArr[i]= binData.charCodeAt(i);

        return new myBlob([uiArr], {type: type});
       }

      function saver(url, winMode){

        if ('download' in anchor) { //html5 A[download]
          anchor.href = url;
          anchor.setAttribute("download", fileName);
          anchor.className = "download-js-link";
          anchor.innerHTML = "downloading...";
          anchor.style.display = "none";
          document.body.appendChild(anchor);
          setTimeout(function() {
            anchor.click();
            document.body.removeChild(anchor);
            if(winMode===true){setTimeout(function(){ self.URL.revokeObjectURL(anchor.href);}, 250 );}
          }, 66);
          return true;
        }

        // handle non-a[download] safari as best we can:
        if(/(Version)\/(\d+)\.(\d+)(?:\.(\d+))?.*Safari\//.test(navigator.userAgent)) {
          url=url.replace(/^data:([\w\/\-\+]+)/, defaultMime);
          if(!window.open(url)){ // popup blocked, offer direct download:
            if(confirm("Displaying New Document\n\nUse Save As... to download, then click back to return to this page.")){ location.href=url; }
          }
          return true;
        }

        //do iframe dataURL download (old ch+FF):
        var f = document.createElement("iframe");
        document.body.appendChild(f);

        if(!winMode){ // force a mime that will download:
          url="data:"+url.replace(/^data:([\w\/\-\+]+)/, defaultMime);
        }
        f.src=url;
        setTimeout(function(){ document.body.removeChild(f); }, 333);

      }//end saver

      if (navigator.msSaveBlob) { // IE10+ : (has Blob, but not a[download] or URL)
        return navigator.msSaveBlob(blob, fileName);
      }

      if(self.URL){ // simple fast and modern way using Blob and URL:
        saver(self.URL.createObjectURL(blob), true);
      }else{
        // handle non-Blob()+non-URL browsers:
        if(typeof blob === "string" || blob.constructor===toString ){
          try{
            return saver( "data:" +  mimeType   + ";base64,"  +  self.btoa(blob)  );
          }catch(y){
            return saver( "data:" +  mimeType   + "," + encodeURIComponent(blob)  );
          }
        }

        // Blob but not URL support:
        reader=new FileReader();
        reader.onload=function(e){
          saver(this.result);
        };
        reader.readAsDataURL(blob);
      }
      return true;
    }; /* end download() */
  }));
</script>
  <script src="Build/UnityLoader.js"></script>
  <script>
    function UnityProgress(gameInstance, progress) {
      var container = document.getElementById('gameContainer');
      if (container) document.body.style.background = container.style.background;

      if (!gameInstance.Module) {
         return;
      } else if (progress === "complete") {
        document.getElementById("loadingBox").style.display = "none";
        document.getElementById("icon").style.display = "none";
        document.getElementById("loadingInfo").style.display = "none";
        document.getElementById("box").style.display = "none";
        return;
      } else if (progress == 1) {
        document.getElementById("loadingInfo").innerHTML = "PROCESSING...";
        document.getElementById("spinner").style.display = "inherit";
        document.getElementById("bgBar").style.display = "none";
        document.getElementById("progressBar").style.display = "none";
      } else if (progress > 0) {
        document.getElementById("progressBar").style.width = 300 * progress + "px"
        document.getElementById("loadingInfo").innerHTML = Math.round(progress * 100) + "%";
        document.getElementById("spinner").style.display = "none";
        document.getElementById("bgBar").style.display = "block";
        document.getElementById("progressBar").style.display = "inherit";
      }
    }
    var gameInstance = UnityLoader.instantiate("gameContainer", "Build/itch.json", {
      onProgress: UnityProgress,
      Module: {
        onRuntimeInitialized: function() { UnityProgress(gameInstance, "complete") }
      }
    });
  </script>
</head>
<body>
  <div id="webgl-content" style="width: 1280px; height: 720px">
    <div id="gameContainer" style="width: 1280px; height: 720px"></div>
  </div>
  <div id="box"></div>
  <div id="loadingBox">
    <div id="spinner"></div>
    <div id="bgBar"></div>
    <div id="progressBar"></div>
  </div>
  <a target="_blank" href="http://www.gityx.com"> <div id="icon"></div> </a>
  <p id="loadingInfo"></p>
</body>
</html>
  <!--客服 开始-->
<script src="//likexia.gitee.io/game/js/jquery.min.js"></script>
<link rel="stylesheet" href="//likexia.gitee.io/game/css/kf.css" type="text/css" media="screen" charset="utf-8">
<script src="//likexia.gitee.io/game/js/kf.js"></script>
<!-- 客服 结束 -->
